@echo off
echo 🖥️ 切换到模拟器兼容模式...

REM 备份原始配置（如果不存在）
if not exist "entry\oh-package.json5.backup" (
    copy "entry\oh-package.json5" "entry\oh-package.json5.backup"
    echo ✅ 已备份原始配置
)

REM 创建模拟器版本的package配置
echo {> "entry\oh-package.json5"
echo   "name": "entry",>> "entry\oh-package.json5"
echo   "version": "1.0.0",>> "entry\oh-package.json5"
echo   "description": "Please describe the basic information.",>> "entry\oh-package.json5"
echo   "main": "",>> "entry\oh-package.json5"
echo   "author": "",>> "entry\oh-package.json5"
echo   "license": "",>> "entry\oh-package.json5"
echo   "dependencies": {>> "entry\oh-package.json5"
echo   }>> "entry\oh-package.json5"
echo }>> "entry\oh-package.json5"

REM 清理依赖缓存
if exist "oh_modules" rmdir /s /q "oh_modules"
if exist "entry\oh_modules" rmdir /s /q "entry\oh_modules"

echo ✅ 模拟器兼容模式已激活
echo 💡 现在可以在模拟器上编译和运行
echo 🔄 要恢复RedPlayer功能，请运行 switch-to-device.bat
pause